﻿using Admin.Repository;
using Admin.Entity;
using Admin.UserInfos;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Admin.Repository.Userinfos
{
    public class UserinfoRepository : BaseRepository<UserInfo>,IUserinfoRepository
    {
        public UserinfoRepository(MS_Context context)
        {
            db = context;
        }

        /// <summary>
        /// 查询用户名
        /// </summary>
        /// <param name="userName"></param>
        /// <returns></returns>
        public UserInfo GetUserName(string userName)
        {
            return db.UserInfos.FirstOrDefault(x => x.UserName == userName || x.UserPhone == userName || x.Email == userName);
        }
    }
}
